﻿using System.Diagnostics.Contracts;
using T4UtilityBelt.DataDesigns;
using T4UtilityBelt.Writers;

namespace T4UtilityBelt.UxDesigns.Controls.Renderers.Windows
{
    public class UserInformationListRenderer : ParentRenderer<UserInformationListControl, IUserInformationListRenderer, ParentOne>, IUserInformationListRenderer
    {
        protected override void OnRenderUiXmlContentInput(UserInformationListControl control, CodeWriter writer)
        {
            Contract.Assert(control != null);
            Contract.Assert(writer != null);

            OnRenderUiXmlContentReadOnly(control, writer);
        }

        protected override void OnRenderUiXmlContentReadOnly(UserInformationListControl control, CodeWriter writer)
        {
            Contract.Assert(control != null);
            Contract.Assert(writer != null);

            //<TextBlock Text=""{{Binding Entry.{0}.Name}}"" />
            writer.WriteBeginTag("TextBlock");

            //RenderControlAttributes(control, writer);

            //writer.WriteAttribute("Text", string.Format(@"{{Binding {0}.Name}}", GetBindingContext(control)));

            writer.WriteFullEnd();
        }
    }
}